# Code options
#----------------------------------------------------------
 OPT += -DONE_LOG           # Default is to write one log per process

# Output options
# ------------------------------------------------------------------------------------------------------
 OPT += -DCUBE               # Default is to write a 2D projection. This option outputs a 3D cube

# Orientation 
# ------------------------------------------------------------------------------------------------------
 OPT += -DUSE_CAM_FILE      # Default is to supply angles as command line argument
 OPT += -DUSE_EIGENVECTORS  # Default is to use angles

# Smoothing lengths
# ------------------------------------------------------------------------------------------------------
 OPT += -DFORCE_EXTERNAL_HSML # Default is to read hsml from snapshot if available		

# Special options for ignoring certain particles
# ------------------------------------------------------------------------------------------------------
#OPT += -DFORCE_EOS         # Umbrella flag for subsequent options that require the EoS flag
#OPT += -DNO_EOS            # (PREREQ: -DFORCE_EOS) Sets weight of EOS particles to zero
#OPT += -DEOS_TEMP=1.0e4    # (PREREQ: -DFORCE_EOS) Fixes temperature (if read in) on EOS particles to specified value


# Velocity fields - need special treatment since they are 3D fields
#------------------------------------------------------------------------------------------------------
 OPT += -DVELOCITY          # Force read of velocities; expects centre of mass velocity at command
                            # line or in camerafile

# I/O options
# ------------------------------------------------------------------------------------------------------
#OPT += -DGADGET2           # Uses the old-style headers and omits Constants, Units, Parameters from IO
#OPT += -DNO_SNAPDIRS       # Code looks for snapshot files in rundir rather than rundir/snapshot_XXX/
#OPT += -DNONEVOLVING       # For generating many grids from a single snapshot - e.g. for flythru movies


# Comp mode selection
#----------------------------------------------------------
COMPMODE = "optimised"
#COMPMODE = "debug"

# System selection
#----------------------------------------------------------
include Makeopt.intel.green

# Compilation
#----------------------------------------------------------
INC             = -I$(HDF5_WRAPPER_MOD) -I$(HDF5_INC) -I$(HDF5_MOD)
LIB             = -L$(HDF5_WRAPPER_LIB) -L$(HDF5_LIB) -L$(OPENMPI_LIB)
OPTIONS         = $(OPT)
EXEC            = GridHDF5
OBJS            = vars.o indexx_module.o rb_seek.o memory.o exchange.o trapzd.o qsimp.o comoving_distance.o grid.o get_unit.o read_parameterfile.o input.o output.o transform.o startup.o abort.o main.o

%.o: %.f Makefile	
	$(FC) $(INC) $(FOPT) $(MOD) $(OPTIONS) -c $<

%.o: %.F90 Makefile	
	$(FC) $(INC) $(FOPT) $(MOD) $(OPTIONS) -c $<

$(EXEC): Makefile $(OBJS)
	$(FC) $(INC) $(FOPT) $(OPTIONS) $(LIB) $(OBJS) -o $(EXEC)

clean:	
	\rm -f *.x *.o *~ *.mod $(EXEC)




